/**
 * 
 */
package it.fuesi.myseries.model;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/**
 * @author fuesi
 * 
 */
public class Season implements Serializable {

	private static final long serialVersionUID = 1875653268700826286L;

	private int number;
	private List<Episode> episodes;

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public List<Episode> getEpisodes() {
		return episodes;
	}

	public void setEpisodes(List<Episode> episodes) {
		this.episodes = episodes;
	}

	@Override
	public String toString() {
		return "Season " + getNumber();
	}

	public void addEpisode(Episode e) {
		if(episodes == null)
			episodes = new LinkedList<Episode>();
		
		e.setSeason(this);
		
		episodes.add(e);
		
	}

}
